package com.financial.sys.service.bank.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.financial.model.pojo.TAccountFlow;
import com.financial.sys.mapper.bank.TAccountFlowsMapper;
import com.financial.sys.query.TAccountFlowQuery;
import com.financial.sys.service.bank.TAccountFlowsService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class TAccountFlowsServiceImpl extends ServiceImpl<TAccountFlowsMapper, TAccountFlow> implements TAccountFlowsService {
    @Override
    public Map<String, Object> selectTAccountFlow(TAccountFlowQuery tAccountFlowQuery) {
        Page<TAccountFlow> page=new Page<>(tAccountFlowQuery.getCurrentPage(),tAccountFlowQuery.getPageSize());
        Page<TAccountFlow>loginLogPage=page.setRecords(baseMapper.selectTAccountFlow(tAccountFlowQuery,page));
        Map<String,Object>map=new HashMap<>();
        map.put("listData",loginLogPage.getRecords());
        map.put("totalPage",loginLogPage.getPages());
        map.put("totalCount",loginLogPage.getTotal());
        map.put("currentPage",tAccountFlowQuery.getCurrentPage());
        map.put("pageSize",tAccountFlowQuery.getPageSize());
        return map;
    }
}
